<!DOCTYPE html>
<html
  layout:decorator="components/layout"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
>
<head>
  <title>多媒体信任域名表</title>
</head>
<body>
<div
  layout:fragment="content"
  id="app" v-cloak
>
  <!--引入边框角-->
  <div class="container">

    <div class="myHeader">
      <div class="myHeader-title">
        多媒体信任域名表
      </div>
      <div class="myHeader-tool">
        <el-form inline>
          <el-form-item label-width="0px">
            <el-button
              type="primary"
              size="mini"
              @click="addInfo"
              v-realm="'system-configuration:sys-media-trust-domains:edit'"
            >新增
            </el-button>
          </el-form-item>

          <el-form-item label="域名:">
            <el-input
              clearable
              size="mini"
              show-word-limit
              maxlength="50"
              v-model="form.domain"
            ></el-input>
          </el-form-item>

          <el-form-item label-width="0px">
            <el-button size="mini" type="primary" icon="el-icon-search" @click="searchPage"></el-button>
          </el-form-item>

        </el-form>
      </div>
    </div>

    <!--内容-->
    <my-table
      :data="page.records"
      :columns="columns"
      @handle-selection-change="selection"
    >
      <template #operating="scope">
          <span>
            <el-button
              type="danger"
              size="mini"
              @click.stop.prevent="del(scope.row)"
              v-realm="'system-configuration:sys-media-trust-domains:edit'"
            >删除</el-button>
          </span>
      </template>
    </my-table>
    <div class="pagination">
      <el-pagination
        background
        @size-change="changeSize"
        @current-change="goto"
        :current-page="page.current"
        :page-sizes="[10, 20, 30]"
        :page-size="page.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page.total"
      >
      </el-pagination>
      <div class="pagination-tool">
        <el-button
          type="primary"
          size="mini"
          @click="showFileSelector"
          v-realm="'system-configuration:sys-media-trust-domains:edit'"
        >导入所有
        </el-button>
        <el-button
          type="primary"
          size="mini"
          @click="exportFile"
          v-realm="'system-configuration:sys-media-trust-domains'"
        >导出所有
        </el-button>
        <el-button
          type="danger"
          size="mini"
          @click="deleteSelected"
          v-realm="'system-configuration:sys-media-trust-domains:edit'"
        >删除
        </el-button>
      </div>
    </div>

    <import-excel
      :file-selector-show="fileSelectorShow"
      @import-file="importFile"
      @reset-file="resetFile"
      @download-template="downloadTemplate"
      title="多媒体信任域名导入"
    ></import-excel>

  </div>
  <el-dialog
    :title="dtitle"
    width="30%"
    :visible.sync="dialogShow"
  >
    <el-form>
      <el-form-item
        label="域名"
        :label-width="formLabelWidth"
      >
        <el-input v-model="formData.domain" name="domain" v-validate="'max:255'"></el-input>
        <span
          class="field-error"
          style="float: right;"
          v-show="errors.has('domain')"
        >{{ errors.first('domain') }}</span>
      </el-form-item>
    </el-form>
    <div
      slot="footer"
      class="dialog-footer"
    >
      <el-button @click="dialogShow = false">取 消</el-button>
      <el-button
        type="primary"
        @click="addData"
        v-realm="'system-configuration:sys-media-trust-domains:edit'"
      >确 定
      </el-button>
    </div>
  </el-dialog>


</div>
</div>
<div layout:fragment="js">
  <script src="/static/js/module/system-config/model/SysMediaTrustDomains.js"></script>
  <script src="/static/js/module/system-config/api/sysMediaTrustDomainsApi.js"></script>
  <script src="/static/js/module/system-config/admin_media_trust_domains.js"></script>
</div>
</body>
</html>
